/*
 * PicturePickerListener.java
 *
 * Research In Motion Limited proprietary and confidential
 * Copyright Research In Motion Limited, 2011-2011
 */
package com.allkapps.bbmopenchat.utils;

import net.rim.device.api.system.EncodedImage;

/**
 * Picking pictures happens in the background so this listener gets events when updated.
 * 
 * @see {@link BBMUtils#pickPicture(PicturePickerListener)}
 * 
 */
public interface PicturePickerListener {

    /**
     * Called when the picture is successfully read into an Encoded image
     * 
     * @param picture
     *            the picture picked
     * @param iconId
     *            the iconId chosen in case of profile box icons
     * 
     * @see {@link BBMUtils#pickPicture(PicturePickerListener)}
     */
    void picturePicked( EncodedImage picture, int iconId );

    /**
     * Called when the picture fails.
     * 
     * @param t
     *            the failure exception. This could be at least one of <code>OutOfMemoryException</code> for big images,
     *            <code>IllegalArgumentException</code> for invalid images, <code>IOException<code> for errors reading an image.
     * 
     * @param filepath
     *            the filepath of the picture
     * 
     * @see {@link BBMUtils#pickPicture(PicturePickerListener)}
     */
    void pickingPictureFailed( Throwable t, String filepath );
}
